/*
 * MODULE NAME:    host_ctrl.h
 * DESCRIPTION:    Host system scheduler interface header
 * AUTHOR:         Martin Mellody
 *
 * SOURCE CONTROL: $Id: host_ctrl.h,v 1.3 2008/12/16 10:20:39 jianguo Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2001 RDA Microelectronics.
 *     All rights reserved.
 *
 */

#ifndef RDABT_HOST_CTRL_H
#define RDABT_HOST_CTRL_H

#include "bt_ctrl.h"

/* 
    These flags will be passed to the per-layer startup/shutdown functions. 
*/
#define RDABT_HOST_STARTUP            0x01
#define RDABT_HOST_SHUTDOWN           0x02
#define RDABT_HOST_RESET              0x04

/* These flags may be passed to BT_Reset */
#define RDABT_HOST_NOHCRESET          0x01
#define RDABT_HOST_NOLINKDISCONNECT   0x02

void rdabt_system_scheduler_execute(void);


/* this structure is currently ignored - currently combined stack only */
struct st_BluestreamStackConfig {
    u_int16 length;
    t_bdaddr deviceAddress; 
    u_int8 countryCode;    
};

/* message dispatch function prototypes */
typedef struct st_rdabt_msg_t rdabt_msg_t;
t_api rdabt_adp_msg_dispatch(rdabt_msg_t *message);

/* layer control function prototypes */
typedef struct st_rdabt_msg_info_t msg_info_t;
#if HCI_PRESENT 
    t_api rdabt_hci_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_hci_msg_dispatch(rdabt_msg_t *message);
#endif

#if MANAGER_PRESENT 
    t_api rdabt_manager_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_manager_msg_dispatch(rdabt_msg_t *message);
#endif

#if L2CAP_PRESENT
    t_api rdabt_l2cap_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_l2cap_msg_dispatch(rdabt_msg_t *message);
#endif

#if SDP_CLIENT
    t_api rdabt_sdp_cli_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_sdp_cli_msg_dispatch(rdabt_msg_t *message);
#endif

#if SDP_SERVER
    t_api rdabt_sdp_srv_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_sdp_srv_msg_dispatch(rdabt_msg_t *message);
#endif

#if RFCOMM_PRESENT
    t_api rdabt_rfcomm_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_rfcomm_msg_dispatch(rdabt_msg_t *message);
#endif

#if HSP_AG
    t_api rdabt_hsp_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_hsp_msg_dispatch(rdabt_msg_t *message);
#endif

#if HFP_AG
    t_api rdabt_hfp_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_hfp_msg_dispatch(rdabt_msg_t *message);
#endif

#if SPP_PRESENT
    t_api rdabt_spp_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_spp_msg_dispatch(rdabt_msg_t *message);
#endif

#if DUN_PRESENT
    t_api rdabt_dun_layer_ctrl(u_int8 layerFlags);
    t_api rdabt_dun_msg_dispatch(rdabt_msg_t *message);
#endif


#if A2DP_PRESENT
    t_api rdabt_avdtp_layer_ctrl(u_int8 flags);
    t_api rdabt_avdtp_msg_dispatch(rdabt_msg_t *message);
#endif

#if AVRCP_PRESENT
    t_api rdabt_avctp_layer_ctrl(u_int8 flags);
    t_api rdabt_avctp_msg_dispatch(rdabt_msg_t *message);
#endif

#if HID_PRESENT
    t_api rdabt_hid_layer_ctrl(u_int8 flags);
    t_api rdabt_hid_msg_dispatch(rdabt_msg_t *message);
#endif

#if AMP_MANAGER_SUPPORT
    t_api rdabt_amp_layer_ctrl(u_int8 flags);
    t_api rdabt_amp_msg_dispatch(rdabt_msg_t *message);
#endif

#if PAL_IN_HOST
    t_api rdabt_pal_layer_ctrl(u_int8 flags);
    t_api rdabt_pal_msg_dispatch(rdabt_msg_t *message);
#endif

/* macros to allow reading the value of preprocessor definitions */
#ifndef BT_STRINGIZE
#define BT_STRINGIZE(x) #x
#endif
#ifndef BT_VALUEOF
#define BT_VALUEOF(x) BT_STRINGIZE(x)
#endif

#endif /* RDABT_HOST_CTRL_H */
